import role_cfg as rc
import datetime

print datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')

b = '100,1001,10001,300'
a = b.split(',')
print a

menu = list(rc.role_id)
ret = list(rc.role_id)
for (i,item) in enumerate(menu):
	if a.count(item['code'])<1:
		ret[i]=''
	else:
		for (j,jtem) in enumerate(item['content']):
			if a.count(jtem['code'])<1:
				ret[i]['content'][j]=''
			elif jtem.has_key('type'):
				continue
			else:
				for (k,ktem) in enumerate(jtem['content']):
					print ktem
					if a.count(dict(ktem)['code'])<1:
						ret[i]['content'][j]['content'][k]=''


print ret